package com.work.farm.dao;

import com.work.farm.pojo.TCustFarmlandHistoryEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface HistoryDao extends Mapper<TCustFarmlandHistoryEntity> {

    //根据大田ID查询历史数据表
    @Select("select * from t_history where fid=#{id}")
    List<TCustFarmlandHistoryEntity> findAllByFid(Integer fid);

    @Insert("INSERT INTO t_history(`fid`, `cid`, `start_time`, `end_time`,`farmstatus`, `dnumber`, `output`, `remarks`) VALUES (#{fid}, #{cname},#{startTime}, #{endTime},#{farmstatus}, #{dnumber}, #{output}, #{remarks})")
    void insertHistory(TCustFarmlandHistoryEntity history);
}
